package qc.module.demo.repository;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import qc.module.demo.entity.Score;

import java.util.List;

@Mapper
public interface ScoreRepository extends BaseMapper<Score> {

    /**
     * 根据学号查询学生成绩信息
     * @param studentNo 学号
     * @author cgy
     * @return 学生成绩集合
     */
    @Select("select course.no courseNo,course.name courseName,score.score from score \n" +
            "left join course on score.courseno = course.no \n" +
            "where score.studentno = #{studentNo}")
    public List<Score> queryByStudentNo(@Param("studentNo")Integer studentNo);
}
